from bottle import Bottle, run
from bottle import get, post, request

@get('/login') # or @route('/login')
def login_form():
    return '''<form method="POST">
                <input name="name"     type="text" />
                <input name="password" type="password" />
                <input type='submit' class='button' value='LOGIN'>
              </form>'''

@post('/login') # or @route('/login', method='POST')
def login_submit():
    name     = request.forms.get('name')
    password = request.forms.get('password')
    if check_login(name, password):
        return "<p>Your login was correct name=%s, password=%s</p>" %(name, password)
    else:
        return "<p>Login failed</p>"

def check_login(name, password):
	return 1

run(host='localhost', port=8080)